<# # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description: Script is designed To Clear All Print Queues from All Printers # Configuration Type - COMPUTER #> # Get all installed printers $printers = Get-Printer Write-Host "################### Remove Print Queue ###################" foreach ($printer in $printers) { Write-Host "`nChecking printer: $($printer.Name)" $printJobs = Get-PrintJob -PrinterName $printer.Name -ErrorAction SilentlyContinue if ($printJobs) { foreach ($job in $printJobs) { Write-Host "Removing job ID $($job.ID) from printer $($printer.Name)..." Remove-PrintJob -InputObject $job } } else { Write-Host "No print jobs found for printer $($printer.Name)." } } Write-Host "`n################### All Queues Checked ###################"